﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CombatLogParser.CommandHandler
{
    public class CombatHandler
        : CommandHandler<Combat>
    {
        public CombatHandler(Combat body)
            :base(body)
        {
            _subCommandList = new Dictionary<string, CommandHandler<Combat>>
            {
            };
        }
        public override void PreHandle()
        {
            foreach (var kvp in _subCommandList)
                Console.WriteLine(kvp.Key);
        }
        public override CommandHandler Handle(string command)
        {
            string[] commandSplit = command.Split(' ');
            CommandHandler<Combat> newHandler;
            if (_subCommandList.TryGetValue(commandSplit[0], out newHandler))
                return newHandler;
            else
                return this;
        }
        private Dictionary<string, CommandHandler<Combat>> _subCommandList;
    }

    public class ByPeopleCommandHandler
        : CommandHandler<Combat>
    {
        public ByPeopleCommandHandler(Combat body)
            : base(body)
        {
        }
        public override void PreHandle()
        {
            throw new NotImplementedException();
        }
        public override CommandHandler Handle(string command)
        {
            throw new NotImplementedException();
        }
    }
}
